@import "../../../assets/sass/variables";
@import "../../../assets/sass/mixin";

.free-range {
  display: inline-block;
  position: relative;
  cursor: pointer;

  &.free-range-vertical {
    .range-bar {
      top: 0;
      left: 50%;
      width: 2px;
      height: 100%;
      transform: translate(-50%, 0);
    }
    .range-bar-active {
      height: auto;
      top: 100%;
    }

    .range-knob-handle {
      top: 100%;
      left: 50%;
    }
  }

  .range-slider-tooltip {
    font-size: 18px;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    padding: 5px 10px;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 6px;
    background-color: #fff;
    text-shadow: 0 1px 0 #f3f3f3;
    transform: translate3d(0, -100%, 0);
  }

  .range-bar {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 4px;
    border-radius: 15px;
    background: #a9acb1;
    pointer-events: none;
    transform: translate(0, -50%);
  }
  .range-bar-active {
    bottom: 0;
    width: auto;
    background: $default;
  }

  .range-knob-handle {
    position: absolute;
    top: 50%;
    left: 0;
    width: 42px;
    height: 42px;
    text-align: center;
    transform: translate(-50%, -50%);
  }

  .range-knob {
    position: absolute;
    top: 7px;
    left: 7px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.4);

    &:before {
      content: "";
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      border-radius: 50%;
      transition: all .25s;
    }

    &:active:before {
      background: rgba(0,0,0,.1);
    }
  }

  @each $theme, $color in $theme {
    &.free-#{$theme} .range-bar-active{
      background: $color;
    }
  }
}
